Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

template file path as option #24

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sl45sms
Copy link

@sl45sms sl45sms commented Dec 8, 2022

Allows to use a custom html template, that is useful if for example you need to use other css framework than bootstrap, or you want the output to be embedded to another page.

@bbk29
Copy link

bbk29 commented Oct 25, 2024

It also would permit us to upgrade Bootstrap too. And make the report itself accessible.


const reportFileName = 'custom_index.html';
const templatePath = path.join(__dirname, 'pageTemplateOnlyBody.html');
const outputDir = 'docs';
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to save the results of test files into the artifacts folder instead of docs because docs is meant only for index.html that is generated by tests but used as source of https://lpelypenko.github.io/axe-html-reporter/. HTML report is saved artifacts by default.

It is easy to do just by removing const outputDir = 'docs'; line and not passing it in createHtmlReport like this:

const templatePath = path.join(__dirname, 'pageTemplateOnlyBody.html');
createHtmlReport({
    results: rawAxeResults,
    options: { projectKey: 'DEQUE', 
    customSummary, reportFileName, templatePath },
});
expect(
    fs.readFileSync(getPathToCreatedReport(reportFileName), {
        encoding: 'utf8',
    })
).toMatchSnapshot();

Thank you!

@lpelypenko
Copy link
Owner

Oh, sorry @sl45sms and @bbk29, it seems it was a pull request from 2022.

I will take it over, rebase and perform changes to marge with target for the next week. Will keep you posted.

@lpelypenko lpelypenko added the enhancement New feature or request label Oct 25, 2024
@lpelypenko lpelypenko self-assigned this Oct 25, 2024
@bbk29
Copy link

bbk29 commented Dec 9, 2024

Any news ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants